package cn.cxy.viewpager2demo;

import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class Fragment2 extends Fragment {
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        TextView tv  =  new TextView(getContext());
        tv.setText("第二页");
        tv.setBackgroundColor(Color.parseColor("#9b95c9"));
        tv.setGravity(Gravity.CENTER);
        return tv;
    }
}